package cn.iocoder.yudao.module.system.dal.mysql.erp.warehouseinsku;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.controller.admin.erp.warehouseinsku.vo.WarehouseInSkuPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.erp.warehouseinsku.WarehouseInSkuDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 入库单sku Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface WarehouseInSkuMapper extends BaseMapperX<WarehouseInSkuDO> {

    default PageResult<WarehouseInSkuDO> selectPage(WarehouseInSkuPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WarehouseInSkuDO>()
                .eqIfPresent(WarehouseInSkuDO::getInWarehouseId, reqVO.getInWarehouseId())
                .eqIfPresent(WarehouseInSkuDO::getNum, reqVO.getNum())
                .betweenIfPresent(WarehouseInSkuDO::getInWarehouseTime, reqVO.getInWarehouseTime())
                .betweenIfPresent(WarehouseInSkuDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(WarehouseInSkuDO::getSku, reqVO.getSku())
                .eqIfPresent(WarehouseInSkuDO::getLength, reqVO.getLength())
                .eqIfPresent(WarehouseInSkuDO::getWidth, reqVO.getWidth())
                .eqIfPresent(WarehouseInSkuDO::getHeight, reqVO.getHeight())
                .eqIfPresent(WarehouseInSkuDO::getWeight, reqVO.getWeight())
                .orderByDesc(WarehouseInSkuDO::getId));
    }

}